<?php

if(!defined("INDEX"))
    die;

// ----------------------------------------------------------------------------

$todo = new Todo;

$smarty->assign('todo', $todo->getTodo());

if(isset($_POST['message']))
    $todo->addTodo($_POST['message']);

if(isset($_GET['done']))
    $todo->closeTodo($_GET['done']);

if(isset($_GET['reopen']))
    $todo->reopenTodo($_GET['reopen']);

if(isset($_GET['delete']))
    $todo->deleteTodo($_GET['delete']);